//项目根组件，   路由配置

import React from 'react';

// 1.导入路由组件
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'
import HouseList from './pages/HouseList/index'
import Home from './pages/Home/index'
import Map from './pages/Map/index'
import CityList from './pages/CityList/index'
import Search from './pages/search/index'


function App() {
    return (
        //2.</Router>包裹
        <Router>
            <div className="App">
                {/* 4.路由匹配 */}
                {/* 搜索页 */}
                <Route path="/Search" component={Search}></Route>
                {/* 城市搜索页 */}
                <Route path="/CityList" component={CityList}></Route>
                {/* 找房页 */}
                <Route path="/HouseList" component={HouseList}></Route>
                {/* 首页页 */}
                <Route path="/Home" component={Home}></Route>
                {/* 地图页 */}
                <Route path="/Map" component={Map}></Route>
                {/* 配置默认路由 */}
                <Route exact path="/" render={() => <Redirect to="/Home"></Redirect>}></Route>

            </div>
        </Router>
    );
}

export default App;